﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BuXiaChu.OrderDishes.BLL;
using BuXiaChu.OrderDishes.Model;
using BuXiaChu.OrderDishes.BLL.Constants;

namespace BuXiaChu.OrderDishes.Web.Admin.Restaurant
{
    public partial class Index : System.Web.UI.Page
    {
        protected List<AreaModel> cityList = null;
        protected List<ShareCodeModel> RestaurantCatList = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {
                InitData();
            }
        }

        private void InitData()
        {
            #region
            cityList = AreaManager.GetListByParentId(0);
            sel_City.Items.Add(new ListItem("不限", "-1"));
            foreach (var item in cityList)
            {
                ListItem li = new ListItem(item.Name, item.Id.ToString());
                sel_City.Items.Add(li);
            }
            
            RestaurantCatList = CodeDictionary.Instance.GetListByClassID(CodeDictionaryConstants.RestaurantCatID);
            sel_Cat.Items.Add(new ListItem("不限", "-1"));
            foreach (var item in RestaurantCatList)
            {
                ListItem li = new ListItem(item.Name, item.CodeID.ToString());
                sel_Cat.Items.Add(li);
            }
            #endregion
        }
    }
}
